package com.server.jaxrs;

import java.util.List;

import javax.ejb.Stateless;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.UriInfo;

import com.server.temp.Category;
import com.server.temp.Type;


@Stateless
@Path("Category")
public class CategoryApi {

    @Context
    private UriInfo context;

    /**
     * Default constructor. 
     */
    public CategoryApi() {
        // TODO Auto-generated constructor stub
    }

    @GET
    @Produces({MediaType.TEXT_PLAIN})
    public String getXml() {
        // TODO return proper representation object
        return "Test is OK!";
    }
    
    /**
     * Retrieves representation of an instance of CategoryApi
     * @return an instance of String
     */
    @GET
    @Produces({MediaType.APPLICATION_ATOM_XML,MediaType.APPLICATION_JSON})
    @Path("{id}")
    public Category getXml(@PathParam (value="id") long id) {
        // TODO return proper representation object
    	List<Type> s= null;
    	Category xx= new Category(id,"fruit",null);
        return xx;
    }

    /**
     * PUT method for updating or creating an instance of CategoryApi
     * @param content representation for the resource
     * @return an HTTP response with content of the updated or created resource.
     */
    @PUT
    @Consumes("application/xml")
    public void putXml(String content) {
    }

}